Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add &tuple:params #215

Merged
merged 9 commits into from
Aug 7, 2023
Merged

add &tuple:params #215

merged 9 commits into from
Aug 7, 2023

Conversation

tiye
Copy link
Member

@tiye tiye commented Jul 30, 2023

No description provided.

@tiye tiye requested a review from a team July 30, 2023 17:51
@tiye
Copy link
Member Author

tiye commented Aug 1, 2023

adding new macro for destructing list with low cost than destruct list:

cargo run --bin cr -- -e 'println $ format-to-cirru $ macroexpand-all $ quote $ list-match ([] 1 2 3) (() 1) ((a b) 2)'
&let
  v__17 $ [] 1 2 3
  if
    not $ list? v__17
    raise "\"|expected a list in list-match\""
  if (empty? v__17)
    &let () 1
    &let
      a $ &list:nth v__17 0
      &let
        b $ &list:slice v__17 1
        &let () 2

@NoEgAm NoEgAm merged commit 72a2105 into main Aug 7, 2023
3 checks passed
@NoEgAm NoEgAm deleted the tuple-params branch August 7, 2023 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants